package Bank;

import org.apache.log4j.Logger;

import javax.naming.InitialContext;
import java.math.BigInteger;
import java.util.Date;

public class TransactionFactory {

    private static final Logger log = Logger.getLogger(TransactionFactory.class);

    public static Transaction createTransaction(BigInteger id, Account src, Account target, User initiator,
                                                double summ, Date date, Transaction.transactionStatus status){
        return new Transaction(id, src, target, initiator, summ, date, status);
    }

    public static Transaction createTransactionAndAddToPool(BigInteger id, Account src, Account target, User initiator,
                                                double summ, Date date, Transaction.transactionStatus status){

        Transaction tr = new Transaction(id, src, target, initiator, summ, date, status);
        TransactionPool.getInstance().addTransaction(tr);
        return tr;
    }
}
